macro

The macro command allows the user to define macros. Macros can be embedded, but another macro cannot be defined from within a macro, mainly because of their common way to refer to arguments. The name of the macro followed by the number of arguments required must be given. The maximum number of arguments a macro can have is 16. An exclamation mark in the macro name will indicate that the macro name can be abbreviated and that the characters following the exclamation point are optional. Macros are only recognized in the fitting mode. The total length of each macro is limited to 2048 bytes in size. Macros can be nested to a maximum of 32. Macros are only recognized from the fitting mode.

macro macroname argument-number
body of the macro
stop

     # define a macro named fpl!ot (o, t, are optional)
     # requiring 3 arguments . Uses the plotting program gnuplot.
     # Syntax: fplot X Y YFIT
     # plot X Y with data points and X YFIT with solid line
     macro fpl!ot 3
         # save vectors in temp file (will be automatically removed on exit)
         save vec $1 $2 $3 $Tmp.fplot
         # plot second column with points and third with line
         pmode plot '$Tmp.fplot' us 1:2 wi point, \
            '$Tmp.fplot' us 1:3 wi line
     stop

append macros, show macros, load, startup, unmacro, alias, unalias